import React from 'react';
import { Alert } from 'react-native';
import { Scene, Actions } from 'react-native-router-flux';
import Form from './Form';
import store from '../models/activity';
import customers from '../../customer/models/customers';
import navBarStyle from '../../../components/navBarStyle';
// import NavBarIconBtn from '../../../components/NavBarIconBtn';
// import Form from '../../../components/Form';
// import MyForm from './myForm';

const alert = Alert.alert;

const pressHandle = (values) => {
  store.addCustomeer(values).then(data => {
    if (data) {
      alert('操作成功', '提交活动客户', [
        { text: '继续添加' },
        { text: '返回', onPress: Actions.pop }
      ]);
    }
  });
};

module.exports = (
  <Scene
    key="addActivityCustomer"
    component={Form}
    path="edit/activity/customer"
    title="提交活动客户"
    hideTabBar
    onSubmit={pressHandle}
    store={store}
    customers={customers}
    {...navBarStyle}
  />);
